<template>
	<!-- 体验会员 -->
	<view>
		<view class="user_vip_experience">
			<view class="" v-if="list.length">
				<view class="user_exper_list" v-for="(item,index) in list" :key="index">
					<view class="user_exper_left">
						<view class="user_exper_title">299会员</view>
						<view class="user_exper_text">领取时间： {{item.claim_time}}</view>
						<view class="user_exper_text">赠送来源： {{item.nickname}}</view>
						<view class="user_exper_text">激活时间： {{item.use_time}}</view>
					</view>
					<view class="user_exper_right">
						<view class="user_exper_activate" @click="jihuoFun(item)" v-if="item.use_uid == 0">去激活</view>
						<view class="user_expergo_activate" v-else>已激活</view>
						<button open-type="share" :data-id="item.id" class="user_exper_send" v-if="item.use_uid == 0">去赠送</button>
					</view>
				</view>
			</view>
			<view v-if="!list.length" class="zanwu">
				暂无数据
			</view>
		</view>
	</view>
</template>

<script>
	import {
		memberRecord
	} from '@/api/user.js';
	import { HTTP_REQUEST_URL } from '@/config/app';
	export default {
		components: {
		},
		data() {
			return {
				list:[],
				imgHost:HTTP_REQUEST_URL,
			};
		},
		
		created() {
			
		},
		onShow() {
			this.getlevelList();
		},
		//#ifdef MP
		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage: function(e) {
			let that = this
			if(e.from == 'button'){
				let share = {
					title: '299元健康体验官会员',
					path: '/pages/users/user_vip_gift/get?id=' + e.target.dataset.id,
					imageUrl: that.imgHost+'/static/images/img_jktyg@2x.png'
				};
				return share;
			}
		},
		//#endif
		methods: {
			getlevelList: function() {
				if (this.loadend) return false;
				if (this.loading) return false;
				memberRecord().then(res => {
					this.list = res.data.list;
					console.log("会员卡列表",res.data)
				}).catch(err => {
					
				});
			},
			jihuoFun(row){
				uni.navigateTo({
					url: '/pages/annex/vip_paid_active/index?type=2&card_number='+row.card_number+'&card_password='+row.card_password
				})
			}
		},
		
	}
</script>
<style>
	page{
		background-color: #ffffff;
	}
</style>
<style lang="scss" scoped>
	.user_vip_experience{
		width: 100%;
		height: auto;
		overflow: hidden;
		padding: 0 30rpx;
		box-sizing: border-box;
	}
	.user_exper_list{
		width: 100%;
		height: auto;
		overflow: hidden;
		padding: 30rpx 10rpx;
		box-sizing: border-box;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: 2rpx solid rgba(0, 0, 0, 0.1);
	}
	.user_exper_left{
		width: 70%;
		height: auto;
	}
	.user_exper_title{
		font-size: 28rpx;
		font-weight: 500;
		line-height:40rpx;
		color: rgba(51, 51, 51, 1);
		margin-bottom: 8rpx;
	}
	.user_exper_text{
		font-size: 24rpx;
		font-weight: 400;
		line-height: 34rpx;
		color: rgba(153, 153, 153, 1);
	}
	.user_exper_right{
		width: 160rpx;
		height: auto;
		overflow: hidden;
	}
	.user_exper_right view,
	.user_exper_right button{
		width: 160rpx;
		height: 48rpx;
		border-radius: 60rpx;
		font-size: 24rpx;
		font-weight: 400;
		line-height: 48rpx;
		text-align: center;
	}
	.user_expergo_activate{
		background: rgba(229, 229, 229, 1);
		color: rgba(255, 255, 255, 1);
	}
	.user_exper_activate{
		border: 2rpx solid rgba(224, 173, 83, 1);
		color: rgba(209, 149, 59, 1);
	}
	.user_exper_send{
		margin-top: 10rpx;
		background: linear-gradient(90deg, rgba(209, 150, 59, 1) 0%, rgba(224, 173, 83, 1) 100%), rgba(229, 229, 229, 1);
		color: #fff;
	}
	.zanwu{
		width: 100%;
		height: auto;
		overflow: hidden;
		line-height: 100rpx;
		color: rgba(0, 0, 0, 0.5);
		font-size: 28rpx;
		text-align: center;
	}
	
</style>